package com.mf.entity.req;

import com.mf.groups.GroupsAddInterface;
import com.mf.groups.GroupsUpdateInterface;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;

/**
 * 撕碎工单提交
 */
@Data
public class ReqRive implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;
    @NotNull(message = "id不能为空", groups = {GroupsUpdateInterface.class})
    @Null(message = "新增id必须为空", groups = {GroupsAddInterface.class})
    private Integer id;

    @NotNull(message = "客户id不能为空", groups = {GroupsAddInterface.class})
    @Schema(description = "客户id")
    private Integer customerId;

    @NotBlank(message = "客户名称不能为空", groups = {GroupsAddInterface.class})
    @Schema(description = "客户名称")
    private String customerName;

    @Schema(description = "虚拟工单标识")
    @NotBlank(message = "虚拟工单标识不能为空", groups = {GroupsAddInterface.class})
    private String workFlag;

    @Schema(description = "投入产出比例")
    @NotNull(message = "投入产出比例不能为空", groups = {GroupsAddInterface.class})
    private Double outRatio;

    @Schema(description = "源头id")
    @NotNull(message = "源头id不能为空", groups = {GroupsAddInterface.class})
    private Integer sourceId;

    @Schema(description = "源工单类型标识")
    @NotNull(message = "源工单类型不能为空", groups = {GroupsAddInterface.class})
    private Integer workSource;

    @Schema(description = "工单绑定明细id集合")
    @NotNull(message = "工单绑定明细id集合不能为空", groups = {GroupsAddInterface.class})
    @Size(min = 1, message = "工单绑定明细id集合不能为空", groups = {GroupsAddInterface.class})
    private List<Integer> ids;
}
